package com.yq.design.proxy.staticProxy;

import com.yq.design.proxy.ITeacherDao;

/**
 * @ClassName TeachProxy
 * @Description 代理对象，通过聚合获取到需要代理的对象，实现代理
 * @Author yaoqiang
 * @Date 2021/2/24 10:06
 * @Version 1.0
 */
public class StaticProxyFactory implements ITeacherDao {
    private ITeacherDao target;

    public StaticProxyFactory(ITeacherDao target) {
        this.target = target;
    }

    @Override
    public void teach() {
        System.out.println("start");
        target.teach();
        System.out.println("end");
    }
}
